Javascript has 7 primitive values as string,number,bigint,boolean,undefined,symbol, null. What I don't understand they are not really objects when we declare them. And their type is not an object. And we can still call methods on strings. How is that possible?
When we create strings(str1 = "aysel" and check typeof is a string then if you check typeof string comes to function. But if I create str2= new String("aysel") Typeof str2 is obj. But we can call str1.length on primitive string too. Although we have never defined as an object on first place.